package org.example.service;

import org.example.controller.request.TrafficPageRequest;
import org.example.controller.request.UseTrafficRequest;
import org.example.model.EventMessage;
import org.example.util.JsonData;
import org.example.vo.TrafficVO;

import java.util.Map;

/**
 * @description:
 * @author: 谢超
 * @date: 2024/9/3 16:27
 */
public interface TrafficService {

    /**
     * 处理流量消息（消费者操作）
     * @param eventMessage
     */
    void handleTrafficMessage(EventMessage eventMessage);

    Map<String, Object> pageAvailable(TrafficPageRequest request);

    TrafficVO detail(long trafficId);

    /**
     * 删除过期流量包
     * @return
     */
    boolean deleteExpireTraffic();

    /**
     * 扣减流量包
     * @param useTrafficRequest
     * @return
     */
    JsonData reduce(UseTrafficRequest useTrafficRequest);
}

